using System;
using DevExpress.Xpo.DB;
using System.ServiceModel;
using Common;

namespace Server
{
    /// <summary>
    /// DataStoreServerProxy
    /// </summary>
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    public class DataStoreServerProxy : IDataStoreContract
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DataStoreServerProxy"/> class.
        /// </summary>
        /// <param name="wrappedDataStore">The wrapped data store.</param>
        public DataStoreServerProxy(IDataStore wrappedDataStore)
        {
            this.wrappedDataStore = wrappedDataStore;
        }

        IDataStore wrappedDataStore;

        #region IDataStoreContract Members

        AutoCreateOption IDataStoreContract.GetAutoCreateOption()
        {
            return wrappedDataStore.AutoCreateOption;
        }

        ModificationResult IDataStoreContract.ModifyData(params ModificationStatement[] dmlStatements)
        {
            return wrappedDataStore.ModifyData(dmlStatements);
        }

        SelectedData IDataStoreContract.SelectData(params SelectStatement[] selects)
        {
            return wrappedDataStore.SelectData(selects);
        }

        UpdateSchemaResult IDataStoreContract.UpdateSchema(bool dontCreateIfFirstTableNotExist, params DBTable[] tables)
        {
            return wrappedDataStore.UpdateSchema(dontCreateIfFirstTableNotExist, tables);
        }

        #endregion
    }
}
